import React from 'react'
import { withRouter } from 'react-router-dom'
import {Card} from "antd-mobile"

function right(props) {
    let { goods,pre,n } = props
    // console.log(goods);
    return (
        <div className='right'>
            {goods.length > 0 ? (
                <>
                    {goods.map((item,index) => {
                        return (
                            <Card title={item.goodsname} onClick={() => { }} key={index}>
                                <img src={pre + item.img} alt="" width={60} />
                                <div>
                                    <p>价格:{item.price}</p>
                                    <p>原价：{item.market_price}</p>
                                </div>
                                <button onClick={() => props.history.push("/detail/" + item.id+"/type=1")}>加入购物车</button>
                            </Card>
                        )
                    })}
                </>
            ) : (<div>暂无数据</div>)}
        </div>
    )
}

export default withRouter(right)